/**
 *
 */
package com.magist.manage.enums;

import com.magist.core.enums.BaseEnum; import com.magist.core.util.TxtUtil;

/**
 * 沟通类型
 */
public enum CommTypeEnum implements BaseEnum {

    TEL("TEL", "电话"), VISIT("VISIT", "拜访"), SJ("SJ",
            "社交工具"), MAIL("MAIL", "邮件"), OTHER("OTHER", "其他");

    private String code;

    private String desc;

    private CommTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static CommTypeEnum getByCode(String code) {
        if (TxtUtil.isEmpty(code))
            return null;
        CommTypeEnum[] allEnums = CommTypeEnum.values();
        for (CommTypeEnum thisEnum : allEnums) {
            if (thisEnum.code.equals(code)) {
                return thisEnum;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
